]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Avoid trailing commas in array destructuring
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jan 2019 19:20:09 +0000 (20:20 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Jul 2019 21:44:11 +0000 (23:44 +0200)
When destructuring multiple return values, we often use trailing commas
to indicate that there are additional elements that we are ignoring.

There isn't anything inherently wrong with that, but it's a style that's
too confusing for eslint - on the one hand we require a space after a
comma, on the other hand we require no space before closing brackets.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

js/ui/dash.js
js/ui/iconGrid.js
js/ui/overviewControls.js
js/ui/status/keyboard.js
js/ui/switcherPopup.js

index 878045410479668d0c3f6969462afbf35acf8573..f010a52ae63fc404201109d84caab8cd2526aae3 100644 (file)
@@ -321,8 +321,8 @@ class DashActor extends St.Widget {
         let themeNode = this.get_theme_node();
         let adjustedForWidth = themeNode.adjust_for_width(forWidth);
         let [, showAppsButton] = this.get_children();
-        let [minHeight, ] = showAppsButton.get_preferred_height(adjustedForWidth);
-        [minHeight, ] = themeNode.adjust_preferred_height(minHeight, natHeight);
+        let [minHeight] = showAppsButton.get_preferred_height(adjustedForWidth);
+        [minHeight] = themeNode.adjust_preferred_height(minHeight, natHeight);
 
         return [minHeight, natHeight];
     }
index 8e5c9c60afb9e0ab68ced5ff4e9b82834c4eccbf..22732f9a196d656571c63bd93238f06dd9362ad9 100644 (file)
@@ -276,7 +276,7 @@ var IconGrid = GObject.registerClass({
         if (forWidth < 0)
             nColumns = children.length;
         else
-            [nColumns, ] = this._computeLayout(forWidth);
+            [nColumns] = this._computeLayout(forWidth);
 
         let nRows;
         if (nColumns > 0)
@@ -504,7 +504,7 @@ var IconGrid = GObject.registerClass({
             this._clonesAnimating.push(actorClone);
             Main.uiGroup.add_actor(actorClone);
 
-            let [width, height,,] = this._getAllocatedChildSizeAndSpacing(actor);
+            let [width, height] = this._getAllocatedChildSizeAndSpacing(actor);
             actorClone.set_size(width, height);
             let scaleX = sourceScaledWidth / width;
             let scaleY = sourceScaledHeight / height;
index f10ba7306439a46e133b1d7eee368e67f31faa79..a58d635247cdcd82a1a4058df699e813e82f6678 100644 (file)
@@ -133,7 +133,7 @@ var SlidingControl = class {
 
     getVisibleWidth() {
         let child = this.actor.get_first_child();
-        let [, , natWidth, ] = child.get_preferred_size();
+        let [, , natWidth] = child.get_preferred_size();
         return natWidth;
     }
 
index 8215a5549e226196f3df009ce8ddef01ba365236..00c3bed9ccbcb5716cca7c7830fd401e28334a7f 100644 (file)
@@ -539,7 +539,7 @@ var InputSourceManager = class {
             let exists = false;
 
             if (type == INPUT_SOURCE_TYPE_XKB) {
-                [exists, displayName, shortName, , ] =
+                [exists, displayName, shortName] =
                     this._xkbInfo.get_layout_info(id);
             } else if (type == INPUT_SOURCE_TYPE_IBUS) {
                 if (this._disableIBus)
@@ -564,7 +564,7 @@ var InputSourceManager = class {
         if (infosList.length == 0) {
             let type = INPUT_SOURCE_TYPE_XKB;
             let id = KeyboardManager.DEFAULT_LAYOUT;
-            let [ , displayName, shortName, , ] = this._xkbInfo.get_layout_info(id);
+            let [ , displayName, shortName] = this._xkbInfo.get_layout_info(id);
             infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
         }
 
index 50a926e2947e02fdf95baae4530301e09d5804bb..86ae768f1e21b4a046c9e6e9aa3d660e51b0de46 100644 (file)
@@ -525,8 +525,8 @@ var SwitcherList = GObject.registerClass({
 
     vfunc_get_preferred_width(forHeight) {
         let themeNode = this.get_theme_node();
-        let [maxChildMin, ] = this._maxChildWidth(forHeight);
-        let [minListWidth, ] = this._list.get_preferred_width(forHeight);
+        let [maxChildMin] = this._maxChildWidth(forHeight);
+        let [minListWidth] = this._list.get_preferred_width(forHeight);
 
         return themeNode.adjust_preferred_width(maxChildMin, minListWidth);
     }